package com.itWaiLong.Mapper;

import com.itWaiLong.Dao.Entities.DeleteGroupProject;
import com.itWaiLong.Dao.group_project;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GroupProjectMapper {
    /**
     * 添加团队项目
     * @param
     * @return
     */
    group_project getProjectByName(String groupName, String projectName);

    /**
     * 添加团队项目
     * @param groupProject
     * @return
     */
    void addGroupProject(group_project groupProject);

    /**
     * 删除项目
     * @param
     * @return
     */
    int delete(DeleteGroupProject deleteGroupProject);

    /**
     * 修改项目信息
     * @param groupProject
     * @return
     */
    int update(group_project groupProject);

    /**
     * 通过项目id查询项目
     * @param projectId
     * @return
     */
    @Select("select * from campus_programming.group_project where project_id = #{projectId}")
    group_project selectProjectById(int projectId);

    /**
     * 查询团队所有项目
     * @param groupName
     * @return
     */
    @Select("select * from campus_programming.group_project where group_name = #{groupName}")
    List<group_project> selectAllProject(String groupName);
}
